package org.microser.gataway.zuul;

import org.microser.gataway.zuul.config.SecurityFilter;
import org.microser.gataway.zuul.filter.AbstractZuulFilter;
import org.microser.gataway.zuul.filter.ErrorFilter;
import org.microser.gataway.zuul.filter.FirstFilter;
import org.microser.gataway.zuul.filter.JwtFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

/**
 * Hello world!
 */
@EnableEurekaClient
@SpringBootApplication
@EnableZuulProxy
public class ServiceZuulApplication 
{
    public static void main( String[] args )
    {
    	SpringApplication.run(ServiceZuulApplication.class, args);
    }

    @Bean
    public AbstractZuulFilter abstractZuulFilter(){
        return new AbstractZuulFilter();
    }

    @Bean
    public SecurityFilter securityFilter(){
        return new SecurityFilter();
    }

    @Bean
    public ErrorFilter errorFilter(){
        return new ErrorFilter();
    }

    @Bean
    public FirstFilter firstFilter(){
        return new FirstFilter();
    }

    @Bean
    public JwtFilter jwtFilter(){
        return new JwtFilter();
    }

}
